package com.evon.yardmanagement.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Interface
 * 
 * @author vgaurav
 * 
 */
@Entity
@Table(name = "SECTION")
@AttributeOverride(name = "id", column = @Column(name = "SECTION_ID"))
public class Section extends BaseModel implements Serializable {

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIsPermanent() {
		return isPermanent;
	}

	public void setIsPermanent(int isPermanent) {
		this.isPermanent = isPermanent;
	}

	public Integer getIsActive() {
		return isActive;
	}

	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}
	
	

	public int getCapacity() {
		return capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}



	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Column(name = "SECTION_NAME")
	private String name;

	@Column(name = "PERMANENT")
	private int isPermanent;

	@Column(name = "ACTIVE")
	private int isActive;
	
	@Column(name= "CAPACITY")
	private int capacity;

	@ManyToOne
	@JoinColumn(name = "YARD_ID")
	private Yard yard;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "section")
	public Set<ParkingSlot> parkingSlots;

	public Yard getYard() {
		return yard;
	}

	public void setYard(Yard yard) {
		this.yard = yard;
	}

	public Set<ParkingSlot> getParkingSlots() {
		return parkingSlots;
	}

	public void setParkingSlots(Set<ParkingSlot> parkingSlots) {
		this.parkingSlots = parkingSlots;
	}

}
